#ifndef MANAGE_BOOKINFO_H
#define MANAGE_BOOKINFO_H

#include <QWidget>
#include <QStandardItemModel>
#include <QVBoxLayout>
#include <QFile>
#include <QDebug>
#include <QCoreApplication>
#include "addbookface.h"
#include "removebookface.h"
#include "modifybookface.h"

namespace Ui {
class manage_bookinfo;
}

class manage_bookinfo : public QWidget
{
    Q_OBJECT

public:
    explicit manage_bookinfo(QWidget *parent = nullptr);
    ~manage_bookinfo();

public slots:
    /* 更新列表 */
    void updateView();

private slots:
    /* 录入图书信息 */
    void on_addBtn_clicked();

    /* 删除图书信息 */
    void on_removeBtn_clicked();

    /* 修改图书信息 */
    void on_modifyBtn_clicked();

private:
    /* 创建模型 */
    void createModel();

    /* 加载图书信息 */
    void loadbookinformation();

    /* 清空表格数据 */
    void clearView();

private:
    Ui::manage_bookinfo *ui;

    QStandardItemModel *model;

    QString appDir;

    addBookface *newAddBookface;

    removeBookface *newRemoveBookface;

    modifyBookface *newModifyBookface;
};

#endif // MANAGE_BOOKINFO_H
